package ipebg.mzk.facade.system.service;

import ipebg.mzk.facade.entity.MsAccessCountRecord;

import java.util.Date;
import java.util.Set;

public interface MsAccessCountRecordService {

	/**
	 * 获得当前在线用户数量
	 * @return
	 * @throws Exception 
	 */
	Long OnlineLoginUserCount() throws Exception;
	
	
	
	
	/**
	 * 记录网站一天的访问量,在线,离线均包括
	 * @param date
	 * @return
	 * @throws Exception 
	 */
	Long LoginCountByDay(Date date) throws Exception;
	
	
	
	/**
	 * 获得当前在线用户清单
	 * @return
	 */
	Set<String> GetOnlineUserList();
		
	/**
	 * 增加Login在线清单
	 * @param userCode
	 */
	void AddOnlineUser(String userCode);
	
	/**
	 * 每小时同步一次當天的数据访问量到DB
	 * @throws Exception 
	 */
	void Persistent2DB() throws Exception;

	/**
	 * 當天網站訪問數加一,按session來
	 * @param sessionId
	 * @throws Exception
	 */
	void AddVisitUser(String sessionId) throws Exception;




	Long VisitCountByDay(Date date) throws Exception;
	
	void update(MsAccessCountRecord record) throws Exception;
	
	MsAccessCountRecord findMsAccessCountRecordByDate(Date	recordDate,String accessType) throws Exception;
	
	/**
	 * 
	 * @param beginDate  format "yyyy/MM/dd"
	 * @param endDate format "yyyy/MM/dd"
	 * @return
	 * @throws Exception
	 */


	Long findAccessCountByDays(String beginDay, String endDay, String accessType) throws Exception;




	void RemoveVisitUser(String sessionId) throws Exception;
}
